<script setup>
import { ref, reactive,onMounted } from 'vue'

// 响应式状态
const counter = reactive({
  count:0
})

// 用来修改状态、触发更新的函数
function increment() {
  counter.count++
  console.log(counter)
}

// 生命周期钩子
// onMounted(() => {
//   console.log(`The initial count is ${counter.value.count}.`)
// })
</script>

<template>
  <button @click="increment">Count is: {{ counter.count }}</button>
</template>